package com.painpointcloud.common.util.core;


/**
 * 服务异常
 * @author kevin
 *
 */
public class ServiceException extends RuntimeException {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String errorCode;
	
	public String getErrorCode() {
		return errorCode;
	}

	public ServiceException(String message) {
		super(message);
	}
	
	public ServiceException(String message, Throwable cause) {
		super(message, cause);
	}

	public ServiceException(String errorCode, String message) {
		super(message);
		this.errorCode = errorCode;
	}

	public ServiceException(String errorCode, String message, Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
	}
	
	public ServiceException(Constant.ManagementCode code, Throwable cause) {
		super(code.getMessage() ,cause);
		this.errorCode = code.getCode();
	}
	
	public ServiceException(Constant.ManagementCode code) {
		super(code.getMessage());
		this.errorCode = code.getCode();
	}
}